package action;

import java.util.Map;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;
import org.apache.struts2.util.ServletContextAware;
/**
 * Action的基类
 */
public class BaseAction implements RequestAware,SessionAware,ApplicationAware,
		ServletRequestAware,ServletContextAware,ServletResponseAware{
	protected Map<String,Object> request;
	protected Map<String,Object> session;
	protected Map<String,Object> application;
	protected HttpServletRequest httpReq;
	protected ServletContext httpApp;
	protected HttpSession httpSession;
	protected HttpServletResponse httpRes;
	
	@Override
	public void setRequest(Map<String, Object> arg0) {
		this.request=arg0;
	}

	@Override
	public void setSession(Map<String, Object> arg0) {
		this.session=arg0;
	}

	@Override
	public void setApplication(Map<String, Object> arg0) {
		this.application=arg0;
	}

	@Override
	public void setServletRequest(HttpServletRequest arg0) {
		this.httpReq=arg0;
		this.httpSession=httpReq.getSession();
	}

	@Override
	public void setServletContext(ServletContext arg0) {
		this.httpApp=arg0;
	}

	@Override
	public void setServletResponse(HttpServletResponse arg0) {
		this.httpRes=arg0;
	}
	
}
